home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / IEditor / Expanders / Function / funcs.c next >
Encoding:
C/C++ Source or Header  |  1997-06-17  |  15.3 KB  |  690 lines

  1. /*
  2. **  $VER: Function.iex 37.0 (3.5.96)
  3. **
  4. **  © 1996 Simone Tellini
  5. **
  6. **    Feel free to adapt it to your own needs.
  7. **
  8. **  PROGRAMNAME:  Function.iex
  9. **
  10. **  FUNCTION:     Add functions to gadgets
  11. **
  12. **  $HISTORY:
  13. **
  14. **   03 May 1996 : 37.0 : initial release
  15. */
  16.  
  17.  
  18. /// Includes
  19. #define INTUI_V36_NAMES_ONLY
  20.  
  21. #include <exec/nodes.h>                 // exec
  22. #include <exec/lists.h>
  23. #include <exec/memory.h>
  24. #include <exec/types.h>
  25. #include <dos/dos.h>                    // dos
  26. #include <intuition/intuition.h>        // intuition
  27. #include <rexx/storage.h>               // rexx
  28. #include <rexx/errors.h>
  29. #include <libraries/reqtools.h>         // libraries
  30. #include <clib/exec_protos.h>           // protos
  31. #include <clib/dos_protos.h>
  32. #include <clib/reqtools_protos.h>
  33. #include <pragmas/exec_pragmas.h>       // pragmas
  34. #include <pragmas/dos_pragmas.h>
  35. #include <pragmas/reqtools_pragmas.h>
  36.  
  37. #include <stdio.h>
  38. #include <stdlib.h>
  39.  
  40. #include "DEV_IE:Expanders/defs.h"
  41. ///
  42. /// Prototypes
  43. /* we use a cut-down version of the ObjectInfo */
  44. struct MyInfo {
  45.     struct  Node        Node;
  46.     UWORD               Kind;
  47.     UBYTE               Flags;
  48.     UBYTE               Pad;
  49.     struct GadgetInfo  *Gadget; /* gadget the function is linked to     */
  50.     APTR                Function;   /* function text                    */
  51. };
  52.  
  53. static BOOL AddFunction( struct IE_Data *, struct GadgetInfo *, UWORD );
  54. static APTR EditFunction( STRPTR );
  55. static APTR FGetString( BPTR );
  56. static void FPutString( BPTR, STRPTR );
  57. static struct WindowInfo *GimmeWnd( ULONG *, struct IE_Data * );
  58. static __geta4 ULONG AddFuncRexxed( __A0 ULONG *, __A1 struct RexxMsg *, __A2 struct IE_Data *, __D0 ULONG );
  59. static __geta4 ULONG RemFuncRexxed( __A0 ULONG *, __A1 struct RexxMsg *, __A2 struct IE_Data *, __D0 ULONG );
  60.  
  61. extern struct Library *ReqToolsBase;
  62. ///
  63. /// Data
  64. static TEXT     Editor[256] = "C:Ed %s";
  65. ///
  66.  
  67.  
  68. /*  Support routines            */
  69. /// GimmeWnd
  70. struct WindowInfo *GimmeWnd( ULONG *Cnt, struct IE_Data *IE )
  71. {
  72.     struct WindowInfo  *wnd;
  73.     UWORD               c;
  74.  
  75.     if( Cnt ) {
  76.     if( *Cnt <= IE->num_win ) {
  77.  
  78.         wnd = (struct WindowInfo *)&IE->win_list;
  79.         for( c = 0; c < *Cnt; c++ )
  80.         wnd = wnd->wi_succ;
  81.  
  82.         return( wnd );
  83.     }
  84.     } else
  85.     return( IE->win_info ); /*  Active Window   */
  86.  
  87.     return( NULL );
  88. }
  89. ///
  90. /// RemFuncRexxed
  91. __geta4 ULONG RemFuncRexxed( __A0 ULONG *ArgArray, __A1 struct RexxMsg *Msg, __A2 struct IE_Data *IE, __D0 ULONG ID )
  92. {
  93.     struct GadgetInfo  *gad;
  94.     struct WindowInfo  *wnd;
  95.     ULONG               cnt, i;
  96.  
  97.     /*  Get the window pointer   */
  98.  
  99.     if(!( wnd = GimmeWnd(( ULONG * )ArgArray[0], IE )))
  100.     return( RC_ERROR );
  101.  
  102.     if( ArgArray[1] ) {     /*  gadget specified ?  */
  103.  
  104.     cnt = *((ULONG *)ArgArray[1]);
  105.  
  106.     /*  Gadget out of range?    */
  107.  
  108.     if((!( wnd->wi_NumGads + wnd->wi_NumObjects )) || ( cnt > wnd->wi_NumGads + wnd->wi_NumObjects ))
  109.         return( RC_WARN );
  110.  
  111.     /*  Get gadget ptr          */
  112.  
  113.     for( gad = wnd->wi_Gadgets.mlh_Head, i = 1; i < cnt; i++ )
  114.         gad = gad->g_Node.ln_Succ;
  115.  
  116.     struct MyInfo  *Info;
  117.  
  118.     /*  Is there a function attached to it? */
  119.  
  120.     for( Info = wnd->wi_Gadgets.mlh_Head; Info->Node.ln_Succ; Info = Info->Node.ln_Succ )
  121.         if(( Info->Kind == ID ) && ( Info->Gadget == gad )) {
  122.         Remove(( struct Node * )Info );
  123.         IE->win_info->wi_NumObjects -= 1;
  124.         FreeVec( Info->Function );
  125.         FreeMem( Info, sizeof( struct MyInfo ));
  126.         break;
  127.         }
  128.  
  129.     } else {    /*  let's remove every function... ;-)  */
  130.  
  131.     struct MyInfo  *Info;
  132.  
  133.     for( Info = wnd->wi_Gadgets.mlh_Head; Info->Node.ln_Succ; Info = Info->Node.ln_Succ )
  134.         if( Info->Kind == ID ) {
  135.         struct MyInfo  *next;
  136.  
  137.         next = Info->Node.ln_Pred;
  138.  
  139.         Remove(( struct Node * )Info );
  140.  
  141.         IE->win_info->wi_NumObjects -= 1;
  142.  
  143.         FreeVec( Info->Function );
  144.  
  145.         FreeMem( Info, sizeof( struct MyInfo ));
  146.         Info = next;
  147.         }
  148.     }
  149.  
  150.     return( RC_OK );
  151. }
  152. ///
  153. /// AddFuncRexxed
  154. __geta4 ULONG AddFuncRexxed( __A0 ULONG *ArgArray, __A1 struct RexxMsg *Msg, __A2 struct IE_Data *IE, __D0 ULONG ID )
  155. {
  156.     struct GadgetInfo  *gad;
  157.     struct WindowInfo  *wnd;
  158.     ULONG               cnt, i, ret;
  159.  
  160.     /*  Get the window pointer   */
  161.  
  162.     if(!( wnd = GimmeWnd(( ULONG * )ArgArray[0], IE )))
  163.     return( RC_ERROR );
  164.  
  165.     if( ArgArray[1] ) {     /*  gadget specified ?  */
  166.  
  167.     cnt = *((ULONG *)ArgArray[1]);
  168.  
  169.     /*  Gadget out of range?    */
  170.  
  171.     if((!( wnd->wi_NumGads + wnd->wi_NumObjects )) || ( cnt > wnd->wi_NumGads + wnd->wi_NumObjects ))
  172.         return( RC_WARN );
  173.  
  174.     /*  Get gadget ptr          */
  175.  
  176.     for( gad = wnd->wi_Gadgets.mlh_Head, i = 1; i < cnt; i++ )
  177.         gad = gad->g_Node.ln_Succ;
  178.  
  179.     ret = AddFunction( IE, gad, ID ) ? RC_OK : RC_FATAL;
  180.  
  181.     } else {    /*  let's take every active gadget... ;-)   */
  182.  
  183.     ret = RC_OK;
  184.  
  185.     for( gad = wnd->wi_Gadgets.mlh_Head; gad->g_Node.ln_Succ; gad = gad->g_Node.ln_Succ )
  186.         if(( gad->g_flags2 & G_ATTIVO ) && ( gad->g_Kind != ID ))
  187.         if(!( AddFunction( IE, gad, ID ))) {
  188.             ret = RC_FATAL;
  189.             break;
  190.         }
  191.     }
  192.  
  193.     return( ret );
  194. }
  195. ///
  196. /// AddFunction
  197. BOOL AddFunction( struct IE_Data *IE, struct GadgetInfo *gad, UWORD ID )
  198. {
  199.     BOOL                ret = FALSE, old = FALSE;
  200.     struct MyInfo      *Info;
  201.     TEXT                Header[ 256 ];
  202.  
  203.  
  204.     for( Info = IE->win_info->wi_Gadgets.mlh_Head; Info->Node.ln_Succ; Info = Info->Node.ln_Succ )
  205.     if(( Info->Kind == ID ) && ( gad == Info->Gadget )) {
  206.         old = TRUE;
  207.         break;
  208.     }
  209.  
  210.  
  211.     if( old ) {
  212.     STRPTR  src, dest;
  213.  
  214.     src  = Info->Function;
  215.     dest = Header;
  216.  
  217.     while( *src == '\n' ) /* skip initial newlines */
  218.         src++;
  219.  
  220.     while(( *src != '\0' ) && ( *src != '\n' ))
  221.         *dest++ = *src++;
  222.  
  223.     *dest = '\0';
  224.  
  225.     } else {
  226.     STRPTR  h;
  227.  
  228.     if( h = ( *IE->IEXFun->GetFirstLine )( Desc, "HEADER" ))
  229.         strcpy( Header, h );
  230.     else
  231.         Header[0] = '\0';
  232.     }
  233.  
  234.     if(( gad->g_Kind >= MIN_IEX_ID ) && (!( old ))) {
  235.     ULONG   tags[] = { RT_ReqPos, REQPOS_CENTERSCR, RT_Underscore, '_',
  236.                RT_Screen, IE->ScreenData->Screen, TAG_DONE };
  237.  
  238.     if( rtEZRequestA( "Gadget kind unknown.\n"
  239.                "Do you want to add a function to it?",
  240.                "_Yes|_No", NULL,
  241.                NULL, (struct TagItem *)tags )) {
  242.  
  243.         if(!( rtGetStringA( Header, 255, "Function.iex", NULL, (struct TagItem *)tags )))
  244.         return( FALSE );
  245.  
  246.     } else
  247.         return( FALSE );
  248.     }
  249.  
  250.     if(!( old ))
  251.     Info = AllocMem( sizeof( struct MyInfo ), MEMF_CLEAR );
  252.  
  253.     if( Info ) {
  254.  
  255.     Info->Kind = ID;       /* DON'T FORGET!!! */
  256.  
  257.     ret = TRUE;
  258.  
  259.     TEXT    file[16];
  260.  
  261.     sprintf( file, "T:%08lx.txt", gad );
  262.  
  263.     DeleteFile( file ); /* Make sure there's no file with this name */
  264.  
  265.     BPTR    fh;
  266.  
  267.     if( fh = Open( file, MODE_NEWFILE )) {
  268.  
  269.         if( old ) {
  270.  
  271.         FPuts( fh, Info->Function );
  272.  
  273.         } else {
  274.         struct Descriptor   Dsc[] = {
  275.             { 'g', gad->g_Label }
  276.         };
  277.         STRPTR  body;
  278.  
  279.         /*  Write an empty template for the function    */
  280.         ( *IE->IEXFun->WriteFormatted )( fh, Header, &Dsc[0] );
  281.  
  282.         if( body = ( *IE->IEXFun->GetFirstLine )( Desc, "BODY" ))
  283.             ( *IE->IEXFun->WriteFormatted )( fh, body, &Dsc[0] );
  284.         }
  285.  
  286.         Close( fh );
  287.  
  288.         APTR    fun;
  289.  
  290.         if( fun = EditFunction( file )) {
  291.  
  292.         if( old )
  293.             FreeVec( Info->Function );
  294.  
  295.         Info->Function = fun;
  296.  
  297.         if(!( old )) {
  298.  
  299.             Info->Gadget = gad;
  300.  
  301.             /* add our object to the list */
  302.             AddTail((struct List *)&IE->win_info->wi_Gadgets, (struct Node *)Info );
  303.  
  304.             IE->win_info->wi_NumObjects += 1;
  305.         }
  306.  
  307.         } else if(!( old ))
  308.         FreeMem( Info, sizeof( struct MyInfo ));
  309.  
  310.         DeleteFile( file );
  311.     }
  312.     }
  313.  
  314.     return( ret );
  315. }
  316. ///
  317. /// EditFunction
  318. APTR EditFunction( STRPTR File )
  319. {
  320.     TEXT    command[ 512 ];
  321.     APTR    Function = NULL;
  322.  
  323.     sprintf( command, Editor, File );
  324.  
  325.     if( SystemTagList( command, NULL ) == 0 ) {
  326.  
  327.     BPTR    lock;
  328.  
  329.     if( lock = Lock( File, ACCESS_READ )) {
  330.  
  331.         struct FileInfoBlock   *fib;
  332.  
  333.         if( fib = AllocDosObject( DOS_FIB, NULL )) {
  334.  
  335.         Examine( lock, fib );
  336.  
  337.         if( fib->fib_Size ) {
  338.             if( Function = AllocVec( fib->fib_Size + 1, MEMF_CLEAR )) {
  339.             /*                                     ^^^
  340.             So we can be sure to have a NULL end
  341.             */
  342.  
  343.             BPTR    fh;
  344.  
  345.             if( fh = Open( File, MODE_OLDFILE )) {
  346.  
  347.                 Read( fh, Function, fib->fib_Size );
  348.                 Close( fh );
  349.             }
  350.             }
  351.         }
  352.  
  353.         FreeDosObject( DOS_FIB, fib );
  354.         }
  355.  
  356.         UnLock( lock );
  357.     }
  358.  
  359.     }
  360.  
  361.     return( Function );
  362. }
  363. ///
  364. /// I/O support functions
  365. APTR FGetString( BPTR File )
  366. {
  367.     ULONG   len;
  368.     UBYTE  *buf = NULL;
  369.  
  370.     FRead( File, &len, 4, 1 );
  371.  
  372.     if( buf = AllocVec( len, 0L )) {
  373.  
  374.     FRead( File, buf, len, 1 );
  375.  
  376.     buf[ len ] = '\0';
  377.  
  378.     if( len & 1 )
  379.         FGetC( File );
  380.     }
  381.  
  382.     return( buf );
  383. }
  384.  
  385. void FPutString( BPTR File, STRPTR str )
  386. {
  387.     ULONG   len;
  388.  
  389.     len = strlen( str );
  390.  
  391.     FWrite( File, &len, 4, 1 );
  392.     FWrite( File, str, len, 1 );
  393.  
  394.     if( len & 1 )
  395.     FPutC( File, 0 );
  396. }
  397. ///
  398.  
  399.  
  400. /*  Starting function           */
  401. /// IEX_Mount
  402. __geta4 ULONG IEX_Mount( __A0 struct IE_Data *IE )
  403. {
  404.     BPTR                    DescFile;
  405.     struct FileInfoBlock   *fib;
  406.     ULONG                   ret = IEX_ERROR_NO_DESC_FILE;
  407.     static UBYTE            FileName[] = "PROGDIR:Expanders/Function.desc";
  408.     struct ExCmdNode        RexxCmd = { 0 };
  409.  
  410.     RexxCmd.Node.ln_Name = "ADDFUNCTION";
  411.     RexxCmd.Template     = "WINDOW/N/K,GADGET/N";
  412.     RexxCmd.Routine      = AddFuncRexxed;
  413.  
  414.     ( *IE->IEXFun->AddARexxCmd )( &RexxCmd );
  415.  
  416.     RexxCmd.Node.ln_Name = "REMOVEFUNCTION";
  417.     RexxCmd.Routine      = RemFuncRexxed;
  418.  
  419.     ( *IE->IEXFun->AddARexxCmd )( &RexxCmd );
  420.  
  421.  
  422.     /*  This part needs to be done just 1 time  */
  423.  
  424.     Forbid();   /* we're going to write to a GLOBAL variable */
  425.  
  426.     if( Desc ) {            /* already done this part? */
  427.     Permit();
  428.     return( IEX_OK );
  429.     }
  430.  
  431.     LibBase->Kind      = IEX_ATTRIBUTE_KIND;
  432.  
  433.     LibBase->Resizable = FALSE;
  434.     LibBase->Movable   = FALSE;
  435.     LibBase->HasItems  = FALSE;
  436.     LibBase->UseFonts  = FALSE;
  437.  
  438.     LibBase->Node.ln_Name = "FUNCTION";
  439.  
  440.     GetVar( "IEditor/FunctionEd", Editor, 256, 0 );
  441.  
  442.     if( fib = AllocDosObject( DOS_FIB, NULL )) {
  443.     if( DescFile = Lock( FileName, ACCESS_READ )) {
  444.  
  445.         Examine( DescFile, fib );
  446.         UnLock( DescFile );
  447.  
  448.         if( Desc = AllocVec( fib->fib_Size, 0L )) {
  449.         if( DescFile = Open( FileName, MODE_OLDFILE )) {
  450.  
  451.             Read( DescFile, Desc, fib->fib_Size );
  452.             Close( DescFile );
  453.  
  454.             ( *IE->IEXFun->SplitLines )( Desc ); // VERY important!
  455.  
  456.             LibBase->Node.ln_Pri = 0;
  457.  
  458.             ret = IEX_OK;
  459.  
  460.         } else {
  461.             FreeVec( Desc );
  462.             Desc = NULL;
  463.         }
  464.         }
  465.  
  466.     }
  467.  
  468.     FreeDosObject( DOS_FIB, fib );
  469.     }
  470.  
  471.     Permit();
  472.  
  473.     return( ret );
  474. }
  475. ///
  476.  
  477.  
  478. /*  Edit functions              */
  479. /// IEX_Add
  480. __geta4 BOOL IEX_Add( __D0 UWORD ID, __A0 struct IE_Data *IE, __D1 WORD x, __D2 WORD y, __D3 UWORD width, __D4 UWORD height )
  481. {
  482.     struct GadgetInfo  *gad;
  483.     BOOL                ret = TRUE;
  484.  
  485.     if( gad = ( *IE->Functions->GetGadget )())
  486.     ret = AddFunction( IE, gad, ID );
  487.  
  488.     return( ret );
  489. }
  490. ///
  491. /// IEX_Remove
  492. __geta4 void IEX_Remove( __D0 UWORD ID, __A0 struct IE_Data *IE )
  493. {
  494.     struct MyInfo  *Info;
  495.  
  496.     for( Info = IE->win_info->wi_Gadgets.mlh_Head; Info->Node.ln_Succ; Info = Info->Node.ln_Succ ) {
  497.     if( Info->Kind == ID ) {
  498.         BOOL                rem = TRUE;
  499.         struct GadgetInfo  *gad;
  500.  
  501.         /* Has the gadget this function is linked to been removed? */
  502.         for( gad = IE->win_info->wi_Gadgets.mlh_Head; gad->g_Node.ln_Succ; gad = gad->g_Node.ln_Succ )
  503.         if( gad == Info->Gadget ) {
  504.             rem = FALSE;
  505.             break;
  506.         }
  507.  
  508.         /* If so, remove also the function... */
  509.         if( rem ) {
  510.         struct MyInfo  *next;
  511.  
  512.         next = Info->Node.ln_Pred;
  513.  
  514.         Remove(( struct Node * )Info );
  515.  
  516.         IE->win_info->wi_NumObjects -= 1;
  517.  
  518.         FreeVec( Info->Function );
  519.  
  520.         FreeMem( Info, sizeof( struct MyInfo ));
  521.         Info = next;
  522.         }
  523.     }
  524.     }
  525. }
  526. ///
  527. /// IEX_Edit
  528. __geta4 BOOL IEX_Edit( __D0 UWORD ID, __A0 struct IE_Data *IE )
  529. {
  530.     return( FALSE );
  531. }
  532. ///
  533. /// IEX_Copy
  534. __geta4 BOOL IEX_Copy( __D0 UWORD ID, __A0 struct IE_Data *IE, __D1 WORD offx, __D2 WORD offy )
  535. {
  536.     return( TRUE );
  537. }
  538. ///
  539. /// IEX_Make
  540. __geta4 struct Gadget *IEX_Make( __D0 UWORD ID, __A0 struct IE_Data *IE, __A1 struct Gadget *glist )
  541. {
  542.     /*  We don't need to make anything  */
  543.     return( glist );
  544. }
  545. ///
  546. /// IEX_Free
  547. __geta4 void IEX_Free( __D0 UWORD ID, __A0 struct IE_Data *IE )
  548. {
  549.     /*  We've got nothing to free when the window is closed  */
  550. }
  551. ///
  552. /// IEX_Refresh
  553. __geta4 void IEX_Refresh( __D0 UWORD ID, __A0 struct IE_Data *IE )
  554. {
  555.     /* Nothing to refresh */
  556. }
  557. ///
  558.  
  559.  
  560. /*  I/O Functions               */
  561. /// IEX_Save
  562. __geta4 void IEX_Save( __D0 UWORD ID, __A0 struct IE_Data *IE, __D1 BPTR File )
  563. {
  564.     struct MyInfo  *Info;
  565.  
  566.     for( Info = IE->win_info->wi_Gadgets.mlh_Head; Info->Node.ln_Succ; Info = Info->Node.ln_Succ )
  567.     if(( Info->Kind == ID ) && (( Info->Gadget->g_flags2 & G_ATTIVO ) || ( Info->Flags & G_ATTIVO ))) {
  568.                    /*  ^^ if the gadget this func is linked to is active
  569.                       if this is active (= when saving all the GUI)   ^^  */
  570.  
  571.         UWORD               num;
  572.         struct GadgetInfo  *gad;
  573.  
  574.         num = 0;
  575.         gad = IE->win_info->wi_Gadgets.mlh_Head;
  576.  
  577.         while( gad != Info->Gadget ) {
  578.         gad = gad->g_Node.ln_Succ;
  579.         num++;
  580.         }
  581.  
  582.         FWrite( File, &num, 2, 1 );
  583.         FPutString( File, Info->Function );
  584.     }
  585. }
  586. ///
  587. /// IEX_Load
  588. __geta4 BOOL IEX_Load( __D0 UWORD ID, __A0 struct IE_Data *IE, __D1 BPTR File, __D2 UWORD Num )
  589. {
  590.     struct MyInfo      *Info;
  591.     struct GadgetInfo  *gad;
  592.     UWORD               cnt, num, i;
  593.  
  594.     for( cnt = 0; cnt < Num; cnt++ ) {
  595.     if( Info = AllocMem( sizeof( struct MyInfo ), MEMF_CLEAR )) {
  596.  
  597.         Info->Kind = ID;  /* VERY important!!! */
  598.  
  599.         FRead( File, &num, 2, 1 );
  600.  
  601.         gad = (struct GadgetInfo *)&IE->win_info->wi_Gadgets.mlh_Head;
  602.         for( i = 0; i <= num; i++ )
  603.         gad = gad->g_Node.ln_Succ;
  604.  
  605.         Info->Gadget = gad;
  606.  
  607.         if( Info->Function = FGetString( File ))
  608.         AddTail(( struct List * )&IE->win_info->wi_Gadgets, ( struct Node * )Info );
  609.         else {
  610.         FreeMem( Info, sizeof( struct MyInfo ));
  611.         return( FALSE );
  612.         }
  613.  
  614.     } else
  615.         return( FALSE );
  616.     }
  617.  
  618.     return( TRUE );
  619. }
  620. ///
  621.  
  622.  
  623. /*  Source related functions    */
  624. /// IEX_StartSrcGen
  625. __geta4 STRPTR IEX_StartSrcGen( __D0 UWORD ID, __A0 struct IE_Data *IE )
  626. {
  627.     return( NULL );
  628. }
  629. ///
  630. /// IEX_WriteGlobals
  631. __geta4 void IEX_WriteGlobals( __D0 UWORD ID, __A0 struct GenFiles *Files, __A1 struct IE_Data *IE )
  632. {
  633. }
  634. ///
  635. /// IEX_WriteSetup
  636. __geta4 void IEX_WriteSetup( __D0 UWORD ID, __A0 struct GenFiles *Files, __A1 struct IE_Data *IE )
  637. {
  638. }
  639. ///
  640. /// IEX_WriteCloseDown
  641. __geta4 void IEX_WriteCloseDown( __D0 UWORD ID, __A0 struct GenFiles *Files, __A1 struct IE_Data *IE )
  642. {
  643. }
  644. ///
  645. /// IEX_WriteHeaders
  646. __geta4 void IEX_WriteHeaders( __D0 UWORD ID, __A0 struct GenFiles *Files, __A1 struct IE_Data *IE )
  647. {
  648.     struct MyInfo      *Info;
  649.     struct WindowInfo  *wnd;
  650.  
  651.     for( wnd = IE->win_list.mlh_Head; wnd->wi_succ; wnd = wnd->wi_succ )
  652.     if( wnd->wi_NumObjects )
  653.         for( Info = wnd->wi_Gadgets.mlh_Head; Info->Node.ln_Succ; Info = Info->Node.ln_Succ )
  654.         if( Info->Kind == ID )
  655.             FPuts( Files->Std, Info->Function );
  656. }
  657. ///
  658. /// IEX_WriteRender
  659. __geta4 void IEX_WriteRender( __D0 UWORD ID, __A0 struct GenFiles *Files, __A1 struct IE_Data *IE )
  660. {
  661. }
  662. ///
  663. /// IEX_GetIDCMP
  664. __geta4 ULONG IEX_GetIDCMP( __D0 UWORD ID, __D1 ULONG idcmp, __A0 struct IE_Data *IE )
  665. {
  666.     return( idcmp );
  667. }
  668. ///
  669. /// IEX_WriteData
  670. __geta4 void IEX_WriteData( __D0 UWORD ID, __A0 struct GenFiles *Files, __A1 struct IE_Data *IE )
  671. {
  672. }
  673. ///
  674. /// IEX_WriteChipData
  675. __geta4 void IEX_WriteChipData( __D0 UWORD ID, __A0 struct GenFiles *Files, __A1 struct IE_Data *IE )
  676. {
  677. }
  678. ///
  679. /// IEX_WriteOpenWnd
  680. __geta4 void IEX_WriteOpenWnd( __D0 UWORD ID, __A0 struct GenFiles *Files, __A1 struct IE_Data *IE )
  681. {
  682. }
  683. ///
  684. /// IEX_WriteCloseWnd
  685. __geta4 void IEX_WriteCloseWnd( __D0 UWORD ID, __A0 struct GenFiles *Files, __A1 struct IE_Data *IE )
  686. {
  687. }
  688. ///
  689.  
  690.